﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AIthin.Neuro
{
    /// <summary>
    /// Model of neuron´s dentrit (output)
    /// </summary>
    [Serializable]
    public class Dendrit
    {
        float Weight;
        public float Signal { get; set; }
        public int ConnectedNeuron { get; set; }
        public int ConnectedAxon { get; set; }
        //public static float SignalRange = 1.0f;
        protected static Random random = new Random();
        public bool Prozessed { get; set; }

        public Dendrit()
        {
            //TODO for input neurons weight is constant
            Weight = 1.5f; // Convert.ToSingle(random.NextDouble());
            Prozessed = false;
        }
       
        public float Out()
        {
            //Debug.Write(this.ConnectedNeuron, "connected neuron");
            //Debug.WriteLine (Signal * Weight, " dendrit out");
            return Signal * Weight;
        }
        public void Reset()
        {
            Prozessed = false;
            Signal = 0;
        }
    }
}
